<table width="100%"><tr><td width="20%">
<a href="../index.html">&lt; index</a><br />
<a href="index.html">&lt; 5. Image toolkit</a>
</td><td width="60%">
<p align="center">
=====================================<br />
5.11 Saving an image to a .bmp or .png file<br />
=====================================<br />
</p></td><td width="20%">
</td></tr></table>
<style type="text/css">
.code { color:#444444; background-color:#EEEEEE;}
pre { color:#444444; background-color:#EEEEEE;}
table.param td { border : 1px solid #000000; }
th { background-color: #44BBFF; color: #FFFFFF }
table.none td { border : 0 }
</style>
You can save an image to a 24 bits .bmp or .png file.<br/>
<p class="code"><pre>
C++ : void TCODImage::save(const char *filename)
C   : void TCOD_image_save(TCOD_image_t image, const char *filename)
Py  : image_save(image, filename)
</pre></p>
<table class="param">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td>image</td><td>In the C version, the image handler, obtained with any image creation function.</td></tr>
<tr><td>filename</td><td>Name of the .bmp or .png file.</td></tr>
</table>
Example :<br />
<p class="code"><pre>
C++ : TCODImage *pix = new TCODImage(10,10);
      pix->save("mypic.bmp");
C   : TCOD_image_t pix = TCOD_image_from_console(my_offscreen_console);
      TCOD_image_save(pix,"mypic.bmp");
Py  : pix = libtcod.image_from_console(my_offscreen_console)
      libtcod.image_save(pix,"mypic.bmp")
</pre></p>
